message(STATUS "-------------PROJECT SETTING-------------")
option(ENABLE_SSL "Enable ssl support" OFF)
message(STATUS "ENABLE_SSL: ${ENABLE_SSL}")
if (ENABLE_SSL)
    find_package(OpenSSL REQUIRED)
    add_compile_definitions(YLT_ENABLE_SSL)
    link_libraries(OpenSSL::SSL OpenSSL::Crypto)
endif ()

option(ENABLE_PMR "Enable pmr support" OFF)
message(STATUS "ENABLE_PMR: ${ENABLE_PMR}")
if (ENABLE_PMR)
    add_compile_definitions(YLT_ENABLE_PMR IGUANA_ENABLE_PMR)
endif ()

option(ENABLE_IO_URING "Enable io_uring" OFF)
message(STATUS "ENABLE_IO_URING: ${ENABLE_IO_URING}")
if (ENABLE_IO_URING)
  find_package(uring REQUIRED)
  message(STATUS "Use IO_URING for all I/O in linux")
  add_compile_definitions(ASIO_HAS_IO_URING ASIO_DISABLE_EPOLL ASIO_HAS_FILE YLT_ENABLE_FILE_IO_URING)
  link_libraries(uring)
endif()

option(ENABLE_FILE_IO_URING "Enable file io_uring" OFF)
if (NOT ENABLE_IO_URING)
  if(ENABLE_FILE_IO_URING)
    find_package(uring REQUIRED)
    message(STATUS "Enable io_uring for file I/O in linux")
    add_compile_definitions(ASIO_HAS_IO_URING ASIO_HAS_FILE YLT_ENABLE_FILE_IO_URING)
    link_libraries(uring)
  endif()
endif()

option(ENABLE_STRUCT_PACK_UNPORTABLE_TYPE "enable struct_pack unportable type(like wchar_t)" OFF)
message(STATUS "ENABLE_STRUCT_PACK_UNPORTABLE_TYPE: ${ENABLE_STRUCT_PACK_UNPORTABLE_TYPE}")
if(ENABLE_STRUCT_PACK_UNPORTABLE_TYPE)
  add_compile_definitions(STRUCT_PACK_ENABLE_UNPORTABLE_TYPE)
endif()

option(ENABLE_STRUCT_PACK_OPTIMIZE "enable struct_pack optimize(but cost more compile time)" OFF)
message(STATUS "ENABLE_STRUCT_PACK_OPTIMIZE: ${ENABLE_STRUCT_PACK_OPTIMIZE}")
if(ENABLE_STRUCT_PACK_OPTIMIZE)
  add_compile_definitions(ENABLE_STRUCT_PACK_OPTIMIZE)
endif()